package com.netease.premissionstudy;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

// 线程的启动
public class ThreadDemo {

    private static class User implements Callable<String> {

        @Override
        public String call() throws Exception {
            System.out.println("run ...");
            return "Liudeli";
        }
    }

    public static void main(String[] args) throws Exception {
        FutureTask futureTask = new FutureTask<String>(new User());
        new Thread(futureTask).start();

        System.out.println("thread result:" + futureTask.get());
    }

}
